package com.magic.ch03_数学与简单DP.买不到的数目;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        System.out.println((n-1)*(m-1)-1);

    }
}
